// 添加用户
/* eslint-disable no-unused-vars */
let {user} = require("./sign_schma.js");
let {system} = require("../system_msg/system_schema.js");
module.exports = {
    signAdd:function(req,res,err){
        let data = req.body;
        console.log(req.body,123);
        user.find({user:data.user}).then((s)=>{
            let len = s.length;
            if(s==0){
                user.create(data);
                // 发送欢迎消息
                system.create({
                    sendUser:"情缘工作组",
                    addressee:data.user,
                    title:"系统消息",
                    core:"1",
                    reply:false,
                    isRead:false,
                    createTime:data.createTime,
                    content:"欢迎加入情缘大家庭！"
                } )
                res.send(true);
            }else{
                res.send(false);
            }
        })
    }
}